import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<UserEditInfoViewState> buildReducer() {
  return asReducer(
    <Object, Reducer<UserEditInfoViewState>>{
      UserEditInfoViewAction.action: _onAction,
      UserEditInfoViewAction.onSelectHeader: _onSelectHeader,
    },
  );
}

UserEditInfoViewState _onAction(UserEditInfoViewState state, Action action) {
  final UserEditInfoViewState newState = state.clone();
  return newState;
}

UserEditInfoViewState _onSelectHeader(
    UserEditInfoViewState state, Action action) {
  final UserEditInfoViewState newState = state.clone();
  newState.selectImage = action.payload;
  return newState;
}
